Column

Chart A: Line Plot

#A line plot showing the counts of items in each aisle
instacart |> 
  count(aisle) |> 
  filter(n > 10000) |> 
  mutate(aisle = fct_reorder(aisle, n)) |> 
  mutate(rank = min_rank(desc(n))) |> 
  arrange(desc(n)) |>
  plot_ly(
    x = ~aisle, y = ~n, type = "scatter", mode = "markers",
    alpha = 0.5)

Column

Chart B: Bar Plot

#A bar plot show what aisle had the most sale during a week.
try_df =
  instacart |> 
  count(aisle) |> 
  filter(n > 10000) 
  
bar_plot =  
  inner_join(try_df, instacart, by = "aisle") |> 
  mutate(order_dow = fct_reorder(order_dow, n)) |> 
  plot_ly(x = ~order_dow, y = ~n, color = ~order_dow, type = "bar", colors = "viridis")  

bar_plot

Chart C: Scatter Plot

#A scatter plot showing an average orders that was ordering within the day. 
instacart |> 
  group_by(order_dow, order_hour_of_day) |> 
  summarise(avg_orders = n()) |> 
  arrange(order_dow,
  order_hour_of_day) |> 
  plot_ly(x= ~order_hour_of_day,
          y= ~avg_orders,
          color = ~order_dow,
          type = "scatter", mode = "markers",
     text = ~order_hour_of_day, alpha = 0.5)
## `summarise()` has grouped output by 'order_dow'. You can override using the
## `.groups` argument.